Apparatus, system, and method for dynamic module flow analysis

ABSTRACT

An apparatus, system, and method are disclosed for analyzing code paths. In one embodiment, a starting point for one or more code paths within a listing of code is specified. The starting point may include code from which one or more code paths flow. An ending point is also specified for one or more code paths within the code, wherein the ending point includes code that is reachable via one or more of the code paths flowing from the starting point. Each code path flowing from the starting point to the ending point is determined by analyzing the listing of code without execution of the code. Information about the determined code paths is provided to a user.

FIELD

This invention relates to testing and analyzing code paths and moreparticularly relates to ensuring code path coverage and code executionpaths for testing and analyzing code.

BACKGROUND Description of the Related Art

In today's computer environment, maintenance costs are often moreexpensive than initial develop costs. Part of the reason for this is thecomplexity of testing and analyzing code paths as products and programsgrow over time. Products sometimes become so large and complex, that ittakes a vast amount of man hours to analyze various code paths to try todetermine how the code got from one point in the code to another pointin the code. It is equally difficult when testing products to ensurecode path coverage or to force a particular code path for execution.

Known technology in this area includes debuggers, which step through thecode as it is executed. In some cases debuggers may utilize simulatorssuch as an instruction set simulator (“ISS”) which provide the abilityto halt execution of the code in response to the occurrence ofparticular events. Debuggers are typically useful in identifying theposition in the code where a failure of the program occurs. Debuggersmay also incorporate additional operations for executing a program suchas single-stepping and stopping the program at various points in thecode. The problem with current debuggers is the inability to ensure codepath coverage of all paths between two points of code. For example, auser may be unable to determine which code path led to a crash of theprogram, and attempts to execute every possible code path may be toocumbersome or complex. Further, debuggers require that the code beexecuted as the debugger operates. This causes additional limitations onthe usefulness of conventional debuggers.

Some debugging tools provide the ability to handle cross-referencing ofvariables and module calls. However, such tools are typically only ableto handle one level of cross referencing, and thus are limited in theirability ensure code path coverage. As products become large and complex,such tools fail to provide adequate information and provide insufficientanalysis of various potential code paths to handle large and complexproducts.

Furthermore, the conventional art lacks the ability to specify astarting point and an ending point in the code for analyzation, andlacks the ability to determine each code path between the two identifiedpoints. Additionally, the prior art lacks the ability to accept someknown variables such that each potential code path based on both knownand unknown variables can be determined. These unsolved problems in theart are resolved by the present invention.

BRIEF SUMMARY

From the foregoing discussion, it should be apparent that a need existsfor an apparatus, system, and method that provide information about andanalysis of code paths within large and complex products. Beneficially,such an apparatus, system, and method would accept a starting point andan ending point, accept any known variable values, and from that build adynamic chart that can plot in various forms the potential code pathsthat could be taken from the starting point to the ending point in thecode. The invention would be able to analyze code listings and createdynamic maps that outline the code flow without execution of the code.

The present invention has been developed in response to the presentstate of the art, and in particular, in response to the problems andneeds in the art that have not yet been fully solved by currentlyavailable code analysis tools. Accordingly, the present invention hasbeen developed to provide an apparatus, system, and method for analyzingcode that overcome many or all of the above-discussed shortcomings inthe art.

The apparatus to analyze code paths is provided with a plurality ofmodules configured to functionally execute the necessary steps of thepresent invention. These modules in the described embodiments include astart module, an end module, a code path analyzer module, and a resultsmodule.

The start module specifies a starting point for one or more code pathswithin a listing of code. The starting point includes code from whichone or more code paths flow. The end module specifies an ending pointfor one or more code paths within the code. The ending point includescode that is reachable via one or more of the code paths flowing fromthe starting point.

The code path analyzer module determines each code path flowing from thestarting point to the ending point The code path analyzer module doesthis by analyzing the listing of code without execution of the code. Theresults module provides information about the determined code paths to auser.

In one embodiment, the code path analyzer module receives one or moreknown variables. Then, the code path analyzer module determines eachpath from the starting point to the ending point that is reachable giventhe one or more known variables. In a further embodiment, one or morevariables are unknown, and the code path analyzer module determines eachcode path from the starting point to the ending point that is reachablebased on potential values of the one or more unknown variable values andbased on the one or more known variable values. In yet a furtherembodiment, the results module identifies potential values for eachunknown variable value corresponding to a particular code path such thatexecution of the code based on the identified values would result inexecution of the particular corresponding code path. The results modulemay also present the identified potential values to the user.

The apparatus, in one embodiment, further comprises a map module thatgenerates a decision map by scanning the listing of code for decisionstatements, each decision statement comprising code from which two ormore code paths diverge. The code path analyzer module utilizes thedecision map to determine each code path between the starting point andending point. In one embodiment, the code path analyzer module traversesthe decision map beginning the specified starting point in a breadthfirst traversal until each code path between the starting point and theending point is determined. In another embodiment, the code pathanalyzer module traverses the decision map beginning with the specifiedending point and working backwards in a breadth-first traversal untileach code path between the starting point and ending point isdetermined.

The apparatus is further configured, in one embodiment, such that thecode path analyzer module accesses a pre-generated decision map todetermine each code path between the starting point and ending point,the decision map comprising a representation of decision statements,each decision statement comprising code from which two or more codepaths diverge.

In various embodiments, the results module may present information anddetails about the code paths various different ways including graphicaland textual representations.

A system of the present invention is also presented to analyze codepaths. The system in the disclosed embodiments substantially includesthe steps necessary to carry out the functions presented above withrespect to the operation of the described apparatus and method. Inparticular, the system, in one embodiment, includes a computer systemcomprising a processor configured to execute program code and a memoryhaving stored there on a listing of code for analyzation. The systemalso includes the modules described above with regard to the apparatusincluding a start module, an end module, a code path analyzer module,and a results module.

A method of the present invention is also presented for analyzing codepaths. The method in the disclosed embodiments substantially includesthe steps necessary to carry out the functions presented above withrespect to the operation of the described apparatus and system. In oneembodiment, the method includes specifying a starting point for one ormore code paths within a listing of code. The starting point may includecode from which one or more code paths flow. The method also may includespecifying an ending point for one or more code paths within the code,wherein the ending point includes code that is reachable via one or moreof the code paths flowing from the starting point.

In a further embodiment, the method includes determining each code pathflowing from the starting point to the ending point by analyzing thelisting of code without execution of the code and providing informationabout the determined code paths to a user.

In some embodiments, the method includes receiving one or more knownvariables, and determining each code path flowing from the startingpoint to the ending point comprises determining each code path from thestarting point to the ending point that is reachable given the one ormore known variables. In further embodiments, one or more variables areunknown, and determining each code path flowing from the starting pointto the ending point comprises determining each path from the startingpoint to the ending point based on the one or more unknown variables andgiven the one or more known variables.

In one embodiment, providing information about the determined code pathsto a user comprises identifying potential values for each unknownvariable value corresponding to a particular code path such thatexecution of the code based on the identified values would result inexecution of the particular corresponding code path and presenting theidentified potential values to the user.

In one embodiment, the method includes generating a decision map byscanning the listing of code for decision statements, each decisionstatement comprising code from which two or more code paths diverge. Thedecision map is utilized to determine each code path between thestarting point and ending point. In a further embodiment, the methodincludes traversing the decision map beginning with the specifiedstarting point and traversing the decision map in a breadth firsttraversal until each code path between the starting point and the endingpoint is determined.

Reference throughout this specification to features, advantages, orsimilar language does not imply that all of the features and advantagesthat may be realized with the present invention should be or are in anysingle embodiment of the invention. Rather, language referring to thefeatures and advantages is understood to mean that a specific feature,advantage, or characteristic described in connection with an embodimentis included in at least one embodiment of the present invention. Thus,discussion of the features and advantages, and similar language,throughout this specification may, but do not necessarily, refer to thesame embodiment.

Furthermore, the described features, advantages, and characteristics ofthe invention may be combined in any suitable manner in one or moreembodiments. One skilled in the relevant art will recognize that theinvention may be practiced without one or more of the specific featuresor advantages of a particular embodiment. In other instances, additionalfeatures and advantages may be recognized in certain embodiments thatmay not be present in all embodiments of the invention.

These features and advantages of the present invention will become morefully apparent from the following description and appended claims, ormay be learned by the practice of the invention as set forthhereinafter.

BRIEF DESCRIPTION OF THE DRAWINGS

In order that the advantages of the invention will be readilyunderstood, a more particular description of the invention brieflydescribed above will be rendered by reference to specific embodimentsthat are illustrated in the appended drawings. Understanding that thesedrawings depict only typical embodiments of the invention and are nottherefore to be considered to be limiting of its scope, the inventionwill be described and explained with additional specificity and detailthrough the use of the accompanying drawings, in which:

FIG. 1 is a schematic block diagram illustrating one embodiment of asystem for analyzing code paths in accordance with the presentinvention;

FIG. 2 is a schematic block diagram illustrating one embodiment of anapparatus for analyzing code paths in accordance with the presentinvention;

FIG. 3 is a schematic flow chart diagram illustrating one embodiment ofa method for analyzing code paths in accordance with the presentinvention;

FIG. 4 is a schematic flow chart diagram illustrating one embodiment ofoutput information resulting from the analyzation of code paths in aaccordance with the present invention;

FIG. 5 is a schematic flow chart diagram illustrating another embodimentof output information resulting from the analyzation of code paths inaccordance with the present invention, and

FIG. 6 is a schematic flow chart diagram illustrating another embodimentof output information resulting from the analyzation of code paths inaccordance with the present invention.

DETAILED DESCRIPTION

Many of the functional units described in this specification have beenlabeled as modules, in order to more particularly emphasize theirimplementation independence. For example, a module may be implemented asa hardware circuit comprising custom VLSI circuits or gate arrays,off-the-shelf semiconductors such as logic chips, transistors, or otherdiscrete components. A module may also be implemented in programmablehardware devices such as field programmable gate arrays, programmablearray logic, programmable logic devices or the like.

Modules may also be implemented in software for execution by varioustypes of processors. An identified module of executable code may, forinstance, comprise one or more physical or logical blocks of computerinstructions which may, for instance, be organized as an object,procedure, or function. Nevertheless, the executables of an identifiedmodule need not be physically located together, but may comprisedisparate instructions stored in different locations which, when joinedlogically together, comprise the module and achieve the stated purposefor the module.

Indeed, a module of executable code may be a single instruction, or manyinstructions, and may even be distributed over several different codesegments, among different programs, and across several memory devices.Similarly, operational data may be identified and illustrated hereinwithin modules, and may be embodied in any suitable form and organizedwithin any suitable type of data structure. The operational data may becollected as a single data set, or may be distributed over differentlocations including over different storage devices, and may exist, atleast partially, merely as electronic signals on a system or network.Where a module or portions of a module are implemented in software, thesoftware portions are stored on one or more computer readable media.

Reference throughout this specification to “one embodiment,” “anembodiment,” or similar language means that a particular feature,structure, or characteristic described in connection with the embodimentis included in at least one embodiment of the present invention. Thus,appearances of the phrases “in one embodiment,” “in an embodiment,” andsimilar language throughout this specification may, but do notnecessarily, all refer to the same embodiment.

Reference to a computer readable storage medium may take any formcapable of storing machine-readable instructions on a digital processingapparatus. A computer readable medium may be embodied by a compact disk,digital-video disk, a magnetic tape, a Bernoulli drive, a magnetic disk,a punch card, flash memory, integrated circuits, or other digitalprocessing apparatus memory device.

Furthermore, the described features, structures, or characteristics ofthe invention may be combined in any suitable manner in one or moreembodiments. In the following description, numerous specific details areprovided, such as examples of programming, software modules, userselections, network transactions, database queries, database structures,hardware modules, hardware circuits, hardware chips, etc., to provide athorough understanding of embodiments of the invention. One skilled inthe relevant art will recognize, however, that the invention may bepracticed without one or more of the specific details, or with othermethods, components, materials, and so forth. In other instances,well-known structures, materials, or operations are not shown ordescribed in detail to avoid obscuring aspects of the invention.

The schematic flow chart diagrams included herein are generally setforth as logical flow chart diagrams. As such, the depicted order andlabeled steps are indicative of one embodiment of the presented method.Other steps and methods may be conceived that are equivalent infunction, logic, or effect to one or more steps, or portions thereof, ofthe illustrated method. Additionally, the format and symbols employedare provided to explain the logical steps of the method and areunderstood not to limit the scope of the method. Although various arrowtypes and line types may be employed in the flow chart diagrams, theyare understood not to limit the scope of the corresponding method.Indeed, some arrows or other connectors may be used to indicate only thelogical flow of the method. For instance, an arrow may indicate awaiting or monitoring period of unspecified duration between enumeratedsteps of the depicted method. Additionally, the order in which aparticular method occurs may or may not strictly adhere to the order ofthe corresponding steps shown.

FIG. 1 is a schematic block diagram illustrating one embodiment of asystem 100 for analyzing code paths in accordance with the presentinvention. The system 100 as depicted includes a computer system 101that includes a processor 102, a memory 104 that includes a code listing106, and a code analyzation apparatus.

The computer system 101 preferably includes various hardware andsoftware components needed to process instructions and commands foranalyzing listings of code 106. As will be recognized by those of skillin the art, a computer system 101 may be embodied in different formsincluding forms such as a personal computer, a laptop, a personaldigital assistant (“PDA”), a cell phone, a server, a client, etc. In atleast one embodiment, the computer system 101 is a mainframe computerthat is running an operating system such as z/OS from InternationalBusiness Machines (“IBM”) of White Plains, N.Y. In some embodiments, thecomputer system 101 may further include networks, network devices, andremote components that are accessible through network connections.

The computer system 101 includes at least one processor 102 or centralprocessing unit (“CPU”) for processing and executing computer programs.The processor 102 is a hardware component and is typically configured toreceive and process instructions from computer programs or otherhardware components. Those of skill in the art will recognize thatproprietary processors are readily available from companies such asIntel or AMD.

The computer system 101 also includes at least one memory 104. A memory104 as used herein is a hardware device that is configured to store datain either a volatile or non-volatile manner. Examples of a memory 104may include random access memory (“RAM”), read-only memory (“ROM”),flash memory, hard disks, floppy disks, magnetic tape, optical discs,etc. In various embodiments, the memory 104 may be local or remote andmay be accessed through the components of the computer system 101.

The memory 104 includes at least one code listing 106 which is a listingof program code or a listing of a portion of program code that may beanalyzed in accordance with the present invention. The code listing 106is preferably accessible by the code analyzation apparatus 108. The codelisting 106 may be stored in various formats and code languages as willbe recognized by those of skill in the art. Preferably, the code listing106 is in a form compatible with the code analyzation apparatus 108 suchthat the code analyzation apparatus 108 is able to access, read, andprocess the code listing 106.

The code analyzation apparatus 108 includes the hardware and logicnecessary to analyze the code listing 106 to determine potential codepaths from a specified starting point to a specified ending point. Aswill be recognized by those of skill in the art, it is possible that aplurality of code paths exist between two points within a code listing,particularly when the code listing is very large and complex.Conventional debuggers and other technologies have been introduced thatattempt to analyze code paths within a defined program, but such toolshave been unable to accurately ensure code path coverage or to force aparticular code path for execution. These tools also typically requireexecution of the code for analyzation and do not allow for thespecification of a starting point and ending point for analysis.Furthermore, conventional tools are limited to only one level of crossreferencing of variables and module calls, and are unable to efficientlydetermine each potential code path between two defined points. Theproblems are resolved by the system 101 and code analyzation apparatus108 as described herein.

In accordance with the present invention, the code analyzation apparatus108 accepts a starting and/or ending module or point and analyzes thecode listing 106 without execution of the code to determine eachpotential code path between the two specified points. By determiningeach potential code path between two specified points in the codelisting 106, a user may be better able to diagnose or resolve problemswith the code or to expand the code to include new programs andfunctionality. For example, if a computer program crashes, a user mayidentify the point at which the program crashed. The user may then beinterested in identifying the various paths that possibly lead to thefailure point from a known starting point. The identification of suchpotential code paths enables for much more efficient code analyzationand troubleshooting.

In one embodiment, the code analyzation apparatus 108 may accept knownvariables such that the code analyzation apparatus 108 determines eachcode path that is reachable between the two specified points given theknown variables. For example, suppose the code branches into two pathsbased on whether a variable value is true or false. If a user isinterested only in paths resulting when the variable equals true, thenthe code analyzation apparatus 108 will find only those paths resultingfrom the branch in the code where the known variable equals true. Thismay be useful, for example, where the user knows that a program faultoccurred after a known variable value was utilized.

FIG. 2 is a schematic block diagram illustrating one embodiment of thecode analyzation apparatus 108 in accordance with the present invention.In the depicted embodiment, the code analyzation apparatus 108 includesa start module, an end module, a code path analyzer module 206, and aresults module 208. In some embodiments, the code analyzation apparatus108 may also include a map module.

In accordance with the present invention, the start module 202 specifiesor accepts a starting point for one or more code paths within a listingof code 106. The starting point typically includes code from which oneor more code paths flow. For example, the starting point may be amodule, instruction, or other point in the code that lead to additionalinstructions, modules, or code path branches. In some embodiments, thestarting point may be the starting point of a program, sub-program, orfunction. In other embodiments, the starting point may be the beginningof a section of code from the code listing 106 where a problem or erroris known to have occurred.

The starting point may be specified by a user in some embodiments. Forexample, the start module 202 may accept as input from a user a startingpoint or starting module at which analysis is to begin. In otherembodiments, the starting point may be defined by a program or may bedefined as some default value. It is also contemplated that the startmodule 202 may be configured to autonomically determine a starting pointbased a feedback results from a program or device. For example, thestart module 202 may receive information that a program failed orcrashed within a particular portion of code. In response to thatinformation the start module 202 may determine a starting point at whichto begin analysis of the code listing.

The end module 204 operates similarly to the start module 202 justdescribed except that the end module 204 operates with regard to anending point instead of a starting point. The end module 204 specifiesor accepts an ending point for one or more code paths within the codeand typically includes code such as a module or instruction that ispreferably reachable via one or more of the code paths flowing from thestarting point. Like the starting point, the ending point may bespecified by user, program, device, or may be determined by the startmodule 204 based on feedback information.

In some embodiments, it may not be known initially that a code pathbetween the starting point and ending point exists. In otherembodiments, it may be known that at least one or more code paths existbetween the starting point and ending point, and a user may interestedto determine all of the potential code paths between the starting pointand the ending point. The code path analyzer module 206 is utilized toaccomplish this function.

The code path analyzer module 206 determines each code path flowing fromthe starting point to the ending point. The code path analyzer module206 preferably does this without execution of the code by analyzing thecode listing. For example, the code path analyzer module 206 may searchthe code listing 106 for statements such as “IF” and “SELECT” statementsor for braches and calls as well as cross referenced modules. From theanalysis of the code listing the code path analyzer module 206 canfollow each possible code path based on potential variable values anddetermine each potential path from the specified starting point to thespecified ending point. During this process, the code path analyzermodule 206 is able to identify not only the potential code paths butalso the variable values that correspond to each potential code path.This information enables a user or program to ensure code path coverageor to force a particular code path for execution during troubleshootingor other processes.

In some embodiments, the code path analyzer module 206 may utilize themap module 210 to access or create a decision map based on the analysisof the code listing 106. The map module generates a decision map byscanning the listing of code for decision statements. Each decisionstatement typically includes code from which two or more code pathsdiverge. From the decision map, the code path analyzer module 206 isable to identify and determine each code path between the starting pointand the ending point. In some embodiments, a pre-generated decision mapmay be available for access by the code path analyzer module 206. Inother embodiments, the map module 210 may generate the decision mapon-the-fly.

Typically, the decision map is generated by traversing the code listingin an organized fashion. For example, the map module 210 or code pathanalyzer module 206 may start at the beginning module and work forwardin a breadth-first traversal, noting all possible code paths that areconsistent with known values. Or conversely, the traversal may begin atthe ending point and work backwards. Of course, other types of traversaltechniques besides breadth-first are contemplated as will be recognizedby those of skill in the art so long as coverage of each potential codepath between the starting point and ending point is enabled.

As noted above, the code path analyzer module 206 in some embodimentsmay receive one or more known variable values. In such an embodiment,the code path analyzer module 206 determines each code path from thestarting point to the ending point that is reachable given the one ormore known variable values. By utilizing known variables, the number ofpotential code paths may be reduced thereby enabling a user to morequickly narrow in on a particular code path of interest. In someembodiments, it is possible that numerous code paths diverge from asingle module in the code listing depending on particular variablevalue. For example, a particular variable ‘A’ might be depend on anumerical value such that one code path results if ‘A=1’ another resultsif ‘A=2’ and another results if ‘A=3’ etc. In such a situation, it maybe useful to limit the determined code paths to those that result if‘A=2’. For example, it might be known that an error in a program onlyoccurs when ‘A=2’ so a user might be interested in focusing in the codepaths that result from that known variable value.

In some embodiments, there are some known and some unknown variables. Insuch embodiments the code path analyzer module 206 may determine eachcode path from the starting point to the ending point that is reachablebased on potential values of the unknown variable values given the knownvariable values. Thus one or more known variables may be utilized whilestill determining each potential code path that may result depending onthe unknown variables.

The results module 208 provides information about the determined codepaths to a user. Typically, this is done in one of a graphical format, atextual format, or both. For example, the results module 208 may presenta graphical representation such as a flow chart depicting a flow of therelevant portions of code, or it may present text describing the codepaths such as one module followed by another (See FIGS. 4 and 5). In oneembodiment, the results module also identifies potential values for eachunknown variable corresponding to a particular code path such thatexecution of the code based on the identified values would result inexecution of the particular corresponding code path. The results module208 may then present the identified potential variable values to theuser. The identified potential variable values may be useful to a userin troubleshooting a software program, such as by forcing execution of aparticular code path or limiting analysis to a particular code path.

FIG. 3 is a schematic flow chart diagram illustrating one embodiment ofa method 300 for analyzing code paths in accordance with the presentinvention. The method 300 substantially includes the modules andembodiments described herein with regard to FIGS. 1, 2, 4, and 5described herein. In at least one embodiment, the method 300 may beimplemented via a computer program product that includes a computerreadable storage medium having computer usable program code executableto perform the operations included in the method.

The method 300 begins when a start module 202 specifies 302 a startingpoint for one or more code paths with a listing of code 106. Preferably,the starting point includes code form which one or more code paths flow.Next, an end module 204 specifies 304 an ending point for one or morecode paths within the code that is reachable via one or more of the codepaths flowing from the starting point.

A code path analyzer module 206 determines 306 each code path flowingfrom the starting point to the ending point by analyzing the listing ofcode 106 without execution of the code. This may be done in someembodiments by utilizing a map module 210 to scan the code listing 106for divergent code paths and generating a decision map corresponding tothe various potential code paths between the starting point and endingpoint. In some embodiments this may include receiving one or more knownvariable values and determining each code path from the starting pointto the ending point that is reachable given the one or more knownvariables. In further embodiments, some variable values may be known andsome variable values unknown and the code path analyzer module 206determines each potential code path based the potential values of theunknown variables given the known variables.

Finally, the results module 208 provides 308 information about thedetermined code paths to a user. The results may be presented in anyform known to those of skill in the art including graphical and textualrepresentations of the code paths and potential variable valuescorresponding to the code paths.

FIG. 4 is a schematic flow chart diagram illustrating one embodiment ofoutput information provided by the results module 208 and resulting fromthe analyzation of code paths in a accordance with the presentinvention. In the depicted embodiment, the output information includesidentification of the program inputs 402 including the starting point(MOD_A), the ending point (MOD_F), and known variables (none). Thus, thedepicted output information provides information including eachpotential path between MOD_A and MOD_F in a code listing 106. Forexample, one path may include the MOD_A, MOD_B, MOD_E, and MOD_F, andanother path might include MOD_A, MOD_D, MOD_J, and MOD_F.

Because there are no known variables, each potential code path isincluded. Provided in the depicted output information is both agraphical representation 404 of the potential code paths as well as atextual representation 406 of the potential code paths. Of course, invarious embodiments, other types of outputs may be utilized includingonly a graphical representation, only a textual representation, oranother representation known to those of skill in the art.

The depicted embodiment also depicts potential variable values 408 thatcorrespond to particular code paths. For example, three potential codepaths diverge from the module ‘MOD_A’ depending on the variable value of‘a’. The potential variable values 408 of ‘a’ include ‘a=1’, ‘a=5’, and‘a=8’. Each of these values will result in a different code path leadingone of modules ‘MOD_B’, ‘MOD_C’, or ‘MOD_D’. Similar potential variablevalues are provided for each potential branch or code path.

In an alternate embodiment, each code path may be depicted individuallyinstead of in a flow chart manner as shown in FIG. 4. For example, aseparate depiction may be provided for each determined code path betweenthe starting point and the ending point. The textual representation 406indicates each individual code path in a singular manner. For example,one path is identified as ‘MOD_A→MOD_B→MOD_E→MOD_F’. A correspondinggraphical representation of individual code paths may similarly beprovided.

FIG. 5 is a schematic flow chart diagram illustrating another embodimentof output information resulting from the analyzation of code paths inaccordance with the present invention. Like FIG. 4, FIG. 5 also depictsprogram inputs 502, a graphical representation of the code paths 504,and a textual representation of the data 506. However, in thisembodiment, the program inputs 502 includes known variables ‘a=5’,‘b=2’, and ‘c=true’. The known variable values limit the potential pathsto a single code path identified by the shaded boxes and including themodules MOD_A, MOD_D, MOD_E, and MOD_F. Again, in an alternateembodiment, the graphical representation may be limited to just the codepath resulting from the known variables or other formats recognized bythose of skill in the art. FIG. 6 is a schematic flow chart diagramillustrating one such example of a graphical representation of a justthe code path resulting from the known variables as specified.

A user may use the information provided in output information of FIGS. 4and 5 to more efficiently analyze code paths, ensure code path coverage,and to force particular code paths for execution. Thus, the presentinvention provides a more efficient and useful tool for analyzing codelistings.

The present invention may be embodied in other specific forms withoutdeparting from its spirit or essential characteristics. The describedembodiments are to be considered in all respects only as illustrativeand not restrictive. The scope of the invention is, therefore, indicatedby the appended claims rather than by the foregoing description. Allchanges which come within the meaning and range of equivalency of theclaims are to be embraced within their scope.

1. An apparatus to analyze code paths, the apparatus comprising: a startmodule that specifies a starting point for one or more code paths withina listing of code, the starting point comprising code from which one ormore code paths flow; an end module that specifies an ending point forone or more code paths within the code, the ending point comprising codethat is reachable via one or more of the code paths flowing from thestarting point; a code path analyzer module that determines each codepath flowing from the starting point to the ending point, the code pathanalyzer module determining each code path from the starting point tothe ending point by analyzing the listing of code without execution ofthe code; and a results module that provides information about thedetermined code paths to a user.
 2. The apparatus of claim 1, whereinthe code path analyzer module receives one or more known variablevalues, the code path analyzer module determining each code path fromthe starting point to the ending point that is reachable given the oneor more known variable values.
 3. The apparatus of claim 2, wherein oneor more variable values are unknown, the code path analyzer moduledetermining each code path from the starting point to the ending pointthat is reachable based on potential values of the one or more unknownvariable values and based on the one or more known variable values. 4.The apparatus of claim 3, wherein the results module identifiespotential values for each unknown variable value corresponding to aparticular code path such that execution of the code based on theidentified values would result in execution of the particularcorresponding code path, the results module presenting the identifiedpotential variable values to the user.
 5. The apparatus of claim 1, theapparatus further comprising a map module that generates a decision mapby scanning the listing of code for decision statements, each decisionstatement comprising code from which two or more code paths diverge, thecode path analyzer module utilizing the decision map to determine eachcode path between the starting point and ending point.
 6. The apparatusof claim 5, wherein the code path analyzer module traverses the decisionmap beginning the specified starting point in a breadth first traversaluntil each code path between the starting point and the ending point isdetermined.
 7. The apparatus of claim 5, wherein the code path analyzermodule traverses the decision map beginning with the specified endingpoint and working backwards in a breadth-first traversal until each codepath between the starting point and ending point is determined.
 8. Theapparatus of claim 1, wherein the code path analyzer module accesses apre-generated decision map to determine each code path between thestarting point and ending point, the decision map comprising arepresentation of decision statements, each decision statementcomprising code from which two or more code paths diverge.
 9. Theapparatus of claim 1, wherein the results module provides a graphicalrepresentation of the determined code paths to a user.
 10. The apparatusof claim 1, wherein the results module provides a textual representationof the determined code paths to a user.
 11. A system to analyze codepaths, the system comprising: a computer system comprising a processorconfigured to execute program code; a memory having stored there on alisting of code for analyzation; a start module that specifies astarting point for one or more code paths within the listing of code,the starting point comprising code from which one or more code pathsflow; an end module that specifies an ending point for one or more codepaths within the code, the ending point comprising code that isreachable via one or more of the code paths flowing from the startingpoint; a code path analyzer module that determines each code pathflowing from the starting point to the ending point, the code pathanalyzer module determining each code path from the starting point tothe ending point by analyzing the listing of code without execution ofthe code; and a results module configured to provide information aboutthe determined code paths to a user.
 12. The system of claim 11, whereinthe code path analyzer module receives one or more known variablevalues, the code path analyzer module determining each path from thestarting point to the ending point that is reachable given the one ormore known variable values.
 13. The system of claim 12, wherein one ormore variable values are unknown, the code path analyzer moduledetermining each code path from the starting point to the ending pointthat is reachable based on potential values of the one or more unknownvariable values and based on the one or more known variable values. 14.The system of claim 13, wherein the results module identifies potentialvalues for each unknown variable value corresponding to a particularcode path such that execution of the code based on the identified valueswould result in execution of the particular corresponding code path, theresults module presenting the identified potential values to the user.15. A computer program product comprising a computer readable storagemedium having computer usable program code executable to performoperations for analyzing code paths, the operations of the computerprogram product comprising: specifying a starting point for one or morecode paths within a listing of code, the starting point comprising codefrom which one or more code paths flow; specifying an ending point forone or more code paths within the code, the ending point comprising codethat is reachable via one or more of the code paths flowing from thestarting point; determining each code path flowing from the startingpoint to the ending point by analyzing the listing of code withoutexecution of the code; and providing information about the determinedcode paths to a user.
 16. The computer program product of claim 15,further comprising receiving one or more known variable values, whereindetermining each code path flowing from the starting point to the endingpoint comprises determining each code path from the starting point tothe ending point that is reachable given the one or more known variablevalues.
 17. The computer program product of claim 16, wherein one ormore variable values are unknown, wherein determining each code pathflowing from the starting point to the ending point comprisesdetermining each path from the starting point to the ending point basedon the one or more unknown variable values and given the one or moreknown variable values.
 18. The computer program product of claim 17,wherein providing information about the determined code paths to a usercomprises identifying potential values for each unknown variable valuecorresponding to a particular code path such that execution of the codebased on the identified values would result in execution of theparticular corresponding code path and presenting the identifiedpotential values to the user.
 19. The computer program product of claim15, further comprising generating a decision map by scanning the listingof code for decision statements, each decision statement comprising codefrom which two or more code paths diverge, the decision map utilized todetermine each code path between the starting point and ending point.20. The computer program product of claim 19, further comprisingtraversing the decision map beginning with the specified starting pointand traversing the decision map in a breadth first traversal until eachcode path between the starting point and the ending point is determined.